﻿//
// File: ErrorListWindow.cs
//
// Purpose:  Error list window.
//
// Author: MotherHacker @ cachecleaner.codeplex.com




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Reporting;

namespace CacheCleaner
{
    public partial class ErrorListWindow : Form, Reporting.ILogListener
    {
        public ErrorListWindow()
        {
            InitializeComponent();

            this.Hide();

        }

        public void EntryAdded(LogEntry entry)
        {
            if ( ! this.Visible )
                this.Show();


            ListViewItem item = new ListViewItem(entry.Category);
            item.SubItems.Add(entry.EventTime.ToShortTimeString() + " " + entry.EventTime.ToShortDateString() );
            item.SubItems.Add(entry.Caption);

            listView1.Items.Add(item);

            
        }
    }
}
